#include "GlobalHead.h"
#include "ViewProviderFreeCamera.h"

#include "Gui_Application.h";
#include "CommandDraftTools.h"
PROPERTY_SOURCE(PartGui::ViewProviderFreeCamera,PartGui::ViewProviderPart)
using namespace PartGui;
using namespace Gui;
ViewProviderFreeCamera::ViewProviderFreeCamera(void)
{
}

ViewProviderFreeCamera::~ViewProviderFreeCamera(void)
{
}

void ViewProviderFreeCamera::attach(App::DocumentObject * pObject)
{
	ViewProviderPart::attach(pObject);
}

bool ViewProviderFreeCamera::setEdit(int ModNum)
{ 
	Command* pcom =  Gui_Application::instance->commandManager().getCommandByName("FreeCamera");
	if(pcom)
	{
		ToolsFreeCamera* pc = static_cast<ToolsFreeCamera*>(pcom);
		pc->activateTools("FreeCamera",pcObject);
	}
	return PartGui::ViewProviderPartExt::setEdit(ModNum);
}

void ViewProviderFreeCamera::unsetEdit(int ModNum)
{
	Command* pcom =  Gui_Application::instance->commandManager().getCommandByName("FreeCamera");
	if(pcom)
	{
		ToolsFreeCamera* pc = static_cast<ToolsFreeCamera*>(pcom);
		pc->deactivateTools("FreeCamera");
	}
	PartGui::ViewProviderPartExt::unsetEdit(ModNum);
}